using JoyfulHomeJourney.BackEnd.Infrastructure.EFCore;
using JoyfulHomeJourney.BackEnd.Infrastructure.Dtos.Responses.Objects;
using JoyfulHomeJourney.BackEnd.Infrastructure.Tools;
using System;
namespace JoyfulHomeJourney.BackEnd.Server.Instances.Extends.Responses
{
    public static class SysVipPackagesExtend
    {
        public static ResponseSysVipPackagesDto ToResponseDto(this SysVipPackages entity, SysProducts product)
        {
            return new ResponseSysVipPackagesDto
            {
                createAt = product.PCreateAt,
                createAtStr = Tools.TimeToString(product.PCreateAt),
                id = entity.VpId,
                month = entity.VpMonth,
                productId = entity.VpProductId,
                updateAt =product.PUpdateAt,
                updateAtStr = Tools.TimeToString(product.PUpdateAt),
                VIPId = entity.VpVipId,
                year = entity.VpYear,
                brand = product.PBrand,
                deduction = product.PDeduction,
                description = product.PDescription,
                discount = product.PDiscount,
                images = product.PImages,
                name = product.PName,
                price = product.PPrice,
                rating = product.PRating,
                saleCount = product.PSaleCount,
                saleSum = product.PSaleSum,
                stockQuantity = product.PStockQuantity,
            };
        }
    }
}
